package com.ocean.nc.domain;

public class NamedTemperatureResult {
    private String locationName;    // 位置名称
    private double longitude;       // 经度
    private double latitude;        // 纬度
    private double temperature;     // 海温值
    private int timeIndex;          // 时间索引

    public NamedTemperatureResult(String locationName, double longitude, double latitude,
                                  double temperature, int timeIndex) {
        this.locationName = locationName;
        this.longitude = longitude;
        this.latitude = latitude;
        this.temperature = temperature;
        this.timeIndex = timeIndex;
    }

    @Override
    public String toString() {
        String tempStr = Double.isNaN(temperature) ? "无效数据" : String.format("%.2f°C", temperature);
        return String.format("%s (%.2f, %.2f) 时间索引 %d: %s",
                locationName, longitude, latitude, timeIndex, tempStr);
    }
}
